using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Web;
using System.Linq;


namespace Component
{
    public class ImgDB
    {
        //static Catching catching = new Catching();
        //static string pathFileXML = HttpContext.Current.Server.MapPath(Config.GetPathXMLOfFileName(PathFileNameXml._Category));
        //public static List<ImgInfo> GetAll()
        //{
        //    List<ImgInfo> result = new List<ImgInfo>();
        //    result = catching.GetObject(StaticCatchingKey._Images_List) as List<ImgInfo>;
        //    if (result != null)
        //        return result;
        //    else
        //    {
        //        result = ProviderXML.GetAll_Images(pathFileXML);
        //        catching.PubObject(StaticCatchingKey._Images_List, result, Config.CatchTimeSpan);
        //        return result;
        //    }
        //}
        //public static List<ImgInfo> GetByParent(int Parent)
        //{
        //    List<ImgInfo> result = new List<ImgInfo>();
        //    result = catching.GetObject(StaticCatchingKey._Images_List) as List<ImgInfo>;
        //    if (result != null)
        //    {
        //        return result.FindAll(x => x.Parent == Parent);

        //    }

        //    else
        //    {
        //        result = ProviderXML.GetAll_Images(pathFileXML);
        //        catching.PubObject(StaticCatchingKey._Images_List, result, Config.CatchTimeSpan);
        //        return result.FindAll(x => x.Parent == Parent);
        //    }
        //}
        //public static ImgInfo GetById(int id)
        //{
        //    List<ImgInfo> list = new List<ImgInfo>();
        //    ImgInfo info = new ImgInfo();
        //    list = catching.GetObject(StaticCatchingKey._Images_List) as List<ImgInfo>;
        //    if (list != null)
        //        return list.Single(c => c.Id == id);
        //    else
        //    {
        //        list = ProviderXML.GetAll_Img(pathFileXML);
        //        info = list.Single(c => c.Id == id);
        //        catching.PubObject(StaticCatchingKey._Img_List, list, Config.CatchTimeSpan);
        //        return info;
        //    }
        //}

        //public static bool Insert(ImgInfo info)
        //{
        //    catching.RemoveObject(StaticCatchingKey._Img_List);
        //    return ProviderXML.Insert_Img(info, pathFileXML);
        //}

        //public static bool Update(ImgInfo info)
        //{
        //    catching.RemoveObject(StaticCatchingKey._Img_List);
        //    return ProviderXML.Update_Img(info, pathFileXML);
        //}

        //public static bool Delete(int id)
        //{
        //    catching.RemoveObject(StaticCatchingKey._Img_List);
        //    return ProviderXML.Detele(id, pathFileXML);
        //}
    }
}
